package com.chenglu.android;



import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @author: lyj
 * @Created: by Copyright 2023/3/7 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：Adapter
 */

public class ComnonPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragments;

    public ComnonPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm,BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }


}